package com.gxa.medical;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.security.reactive.ApplicationContextServerWebExchangeMatcher;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;


//@SpringBootApplication表示该程序是一个spring boot类型的应用程序
//聚合注解
//@SpringBootConfiguration配置功能
//@EnableAutoConfiguration自动配置功能
//@ComponentScan组件扫描
@SpringBootApplication
//开启事务
@EnableTransactionManagement
//@MapperScan("com.gxa.medical.mapper")
public class MainApp {
    public static void main(String[] args) {
        SpringApplication.run(MainApp.class);
    }

//添加分页插件
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    //添加支持mysql的分页插件
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return interceptor;
}

}
